Raspberry 4 can be used with either a 32-bit armv7l/armhf operating system (usually Raspbian) or a 64-bit aarch64 OS like Debian, Ubuntu, Arch or 64-bit Raspbian.
When using a 32-bit Raspbian the installation is done as for Raspberry Pi 2/3 For 64-bit aarch64/amd64 OSes Opencpn is installed using Flatpak, there is no difference to using desktop OSes like Ubuntu or Fedora. See Flatpak
You can also use OpenCPN in Raspberry 4 using OpenPlotter for 32bit or 64bit: https://openplotter.readthedocs.io/en/latest/
Android on RPI 4 -LineageOS 19 for Raspberry Pi 4 Model B, Pi 400, and Compute Module 4